package com.medical.data.constEnum;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

@AllArgsConstructor
@Getter
public enum FormItemEnum {


    INPUT("单行文本","INPUT"),
    NUMBER("数字","NUMBER"),
    TEXTAREA("多行文本","TEXTAREA"),
    SELECT("下拉框","SELECT"),
    CASCADER("级联选择","CASCADER"),
    SORT("排序","SORT"),
    SLIDER("滑块","SLIDER"),
    RADIO("单选框","RADIO"),
    CHECKBOX("多选框","CHECKBOX"),
    DATE("日期选择","DATE"),
    DATE_RANGE("日期范围","DATE_RANGE"),
    RATE("评分","RATE"),
    IMAGE_UPLOAD("图片上传","IMAGE_UPLOAD"),
    UPLOAD("文件上传组件","UPLOAD"),
    IMAGE("图片展示","IMAGE"),
    IMAGE_SELECT("图片选择","IMAGE_SELECT"),
    IMAGE_CAROUSEL("图片轮播","IMAGE_CAROUSEL"),
    DESC_TEXT("文字描述","DESC_TEXT"),
    SIGN_PAD("手写签名","SIGN_PAD"),
    PAGINATION("分页","PAGINATION"),
    DIVIDER("分割线","DIVIDER"),
    PROVINCE_CITY("省市联动","PROVINCE_CITY"),
    PHONE_VERIFICATION("手机号验证","PHONE_VERIFICATION"),
    SUB_FORM("子表单","SUB_FORM"),
    INPUT_MAP("地理位置","INPUT_MAP"),
    MATRIX_INPUT("矩阵填空","MATRIX_INPUT"),
    MATRIX_SCALE("矩阵量表","MATRIX_SCALE"),
    HORIZONTAL_INPUT("横向填空","HORIZONTAL_INPUT"),
    MATRIX_SELECT("矩阵选择","MATRIX_SELECT"),
    USER_SELECT("成员选择","USER_SELECT"),
    DEPT_SELECT("部门选择","DEPT_SELECT"),
    OCR("文字识别","OCR"),
    RANDOM_NUMBER("随机编号","RANDOM_NUMBER"),
    FUNCTION_CALC("函数计算","FUNCTION_CALC"),
    GOODS_SELECT("商品选择","GOODS_SELECT"),
    RESERVE_DAY("预约日期","RESERVE_DAY"),
    RESERVE_TIME_RANGE("预约时段","RESERVE_TIME_RANGE");
    @ApiModelProperty(value = "组件描述")
    private String desc;
    @ApiModelProperty(value = "组件名字")
    private String name;

    private static Map<String,FormItemEnum> map = new HashMap<>();

    static {
        for (FormItemEnum value : FormItemEnum.values()) {
            map.put(value.name, value);
        }
    }
    public static FormItemEnum getFormItemEnum(String name) {
        return map.get(name);
    }
}
